package org.example.springcloud.feign;

import feign.hystrix.FallbackFactory;
import org.example.springcloud.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@Component
public class FeignClient01Factory implements FallbackFactory<FeignClient01> {
    @Override
    public FeignClient01 create(Throwable throwable) {
        return new FeignClient01(){

            @Override
            public User getOrder(long id) {
                return new User(-200);
            }
        };
    }
}
